package com.eco.fanliapp.service;

import com.eco.fanliapp.entity.AppOrderDetail;
import com.eco.fanliapp.entity.AppUser;
import com.eco.fanliapp.vo.OrderDetailInfo;

import java.util.ArrayList;
import java.util.List;

public class OrderDetailUtils {


    public static List<OrderDetailInfo> getOrderDetailInfo(List<AppOrderDetail> appOrderDetails){
        ArrayList<OrderDetailInfo> orderDetailInfos = new ArrayList<>();
        //查询用户的详情
        for (AppOrderDetail orderDetail : appOrderDetails){
            OrderDetailInfo orderDetailInfo = new OrderDetailInfo();
            orderDetailInfo.setOrderDetail(orderDetail);
            Long taobaoUserId = orderDetail.getTaobaoUserId();
            AppUser appUser = null;
            orderDetailInfo.setUserName(appUser.getUserName());
            orderDetailInfo.setWechatUnionid(appUser.getWechatUnionid());
            // 设置直接粉丝佣金
            orderDetailInfo.setPrimaryFansCommission(2.00);
            // 设置间接粉丝佣金
            orderDetailInfo.setSecondaryFansCommission(2.00);
            orderDetailInfos.add(orderDetailInfo);
        }
        return orderDetailInfos;
    }


}
